package com.huasan.www.demon.rest.resource;

import java.io.IOException;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.springframework.beans.factory.annotation.Autowired;

import com.huasan.www.demon.data.service.OperatorsService;
import com.huasan.www.demon.pojo.OperatorsExample;

@Path("/opt")
public class OperatorResource extends Resource{
	
	@Autowired
	OperatorsService operatorsService;
	
	@GET
	@Path("/opts")
	@Produces({MediaType.APPLICATION_JSON} )
	public String getOprators() throws JsonGenerationException, JsonMappingException, IOException{
		OperatorsExample example = new OperatorsExample();
		return getSucReturn(objectmapper.writeValueAsString(operatorsService.selectByExample(example)), "") ;
	}
}
